/*
 * XML Type:  Data
 * Namespace: http://ws.saly.com
 * Java type: com.saly.ws.Data
 *
 * Automatically generated - do not modify.
 */
package com.saly.ws.impl;
/**
 * An XML Data(@http://ws.saly.com).
 *
 * This is a complex type.
 */
public class DataImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements com.saly.ws.Data
{
    
    public DataImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName STUDENTS$0 = 
        new javax.xml.namespace.QName("", "students");
    
    
    /**
     * Gets the "students" element
     */
    public com.saly.ws.Student getStudents()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.saly.ws.Student target = null;
            target = (com.saly.ws.Student)get_store().find_element_user(STUDENTS$0, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * Tests for nil "students" element
     */
    public boolean isNilStudents()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.saly.ws.Student target = null;
            target = (com.saly.ws.Student)get_store().find_element_user(STUDENTS$0, 0);
            if (target == null) return false;
            return target.isNil();
        }
    }
    
    /**
     * True if has "students" element
     */
    public boolean isSetStudents()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(STUDENTS$0) != 0;
        }
    }
    
    /**
     * Sets the "students" element
     */
    public void setStudents(com.saly.ws.Student students)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.saly.ws.Student target = null;
            target = (com.saly.ws.Student)get_store().find_element_user(STUDENTS$0, 0);
            if (target == null)
            {
                target = (com.saly.ws.Student)get_store().add_element_user(STUDENTS$0);
            }
            target.set(students);
        }
    }
    
    /**
     * Appends and returns a new empty "students" element
     */
    public com.saly.ws.Student addNewStudents()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.saly.ws.Student target = null;
            target = (com.saly.ws.Student)get_store().add_element_user(STUDENTS$0);
            return target;
        }
    }
    
    /**
     * Nils the "students" element
     */
    public void setNilStudents()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.saly.ws.Student target = null;
            target = (com.saly.ws.Student)get_store().find_element_user(STUDENTS$0, 0);
            if (target == null)
            {
                target = (com.saly.ws.Student)get_store().add_element_user(STUDENTS$0);
            }
            target.setNil();
        }
    }
    
    /**
     * Unsets the "students" element
     */
    public void unsetStudents()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(STUDENTS$0, 0);
        }
    }
}
